package CarManagement;

import java.util.Calendar;

public class Car {
    public Car(String id, String license, String company, String buyTime, String type, int mile, float oilConsumption, int protectMoney, int roadMoney, float sum) {
        this.id = id;
        this.license = license;
        this.company = company;
        this.buyTime = buyTime;
        this.type = type;
        this.mile = mile;
        this.oilConsumption = oilConsumption;
        this.protectMoney = protectMoney;
        this.roadMoney = roadMoney;
        this.sum = sum;
    }

    public String id;
    public String license;
    public String company;
    public String buyTime;
    public String type;
    public int mile;
    public float oilConsumption;
    public int protectMoney;
    public int roadMoney;
    public float sum;

    @Override
    public String toString() {
        return "Car{" +
                "id='" + id + '\'' +
                ", license='" + license + '\'' +
                ", company='" + company + '\'' +
                ", buyTime='" + buyTime + '\'' +
                ", type='" + type + '\'' +
                ", mile=" + mile +
                ", oilConsumption=" + oilConsumption +
                ", protectMoney=" + protectMoney +
                ", roadMoney=" + roadMoney +
                ", sum=" + sum +
                '}';
    }

    public String getId() {
        return id;
    }

    public String getLicense() {
        return license;
    }

    public String getCompany() {
        return company;
    }

    public String getBuyTime() {
        return buyTime;
    }

    public String getType() {
        return type;
    }

    public int getMile() {
        return mile;
    }

    public float getOilConsumption() {
        return oilConsumption;
    }

    public int getProtectMoney() {
        return protectMoney;
    }

    public int getRoadMoney() {
        return roadMoney;
    }

    public float getSum() {
        return sum;
    }
}

class BigCar extends Car {
    public BigCar(String id, String license, String company, String buyTime, String type, int mile, float oilConsumption, int protectMoney, int roadMoney, float sum, int passengerNum) {
        super(id, license, company, buyTime, type, mile, oilConsumption, protectMoney, roadMoney, sum);
        this.passengerNum = passengerNum;
    }

    public int getPassengerNum() {
        return passengerNum;
    }

    public int passengerNum;

    @Override
    public String toString() {
        return "大客车：\n(" +
                "车辆编号：" + id +
                ", 车牌号：" + license +
                ", 制造公司：" + company +
                ", 购买时间：" + buyTime +
                ", 公里数：" + mile +
                ", \n耗油量：" + oilConsumption +
                ", 基本保养费用：" + protectMoney +
                ", 养路费：" + roadMoney +
                ", 累计费用：" + sum +
                ", 最大乘客量：" + passengerNum+")";
    }
}

class SmallCar extends Car{
    public SmallCar(String id, String license, String company, String buyTime, String type, int mile, float oilConsumption, int protectMoney, int roadMoney, float sum, int boxNum) {
        super(id, license, company, buyTime, type, mile, oilConsumption, protectMoney, roadMoney, sum);
        this.boxNum = boxNum;
    }

    public int boxNum;
    @Override
    public String toString() {
        return "小轿车：\n(" +
                "车辆编号：" + id +
                ", 车牌号：" + license +
                ", 制造公司：" + company +
                ", 购买时间：" + buyTime +
                ", 公里数：" + mile +
                ", \n耗油量：" + oilConsumption +
                ", 基本保养费用：" + protectMoney +
                ", 养路费：" + roadMoney +
                ", 累计费用：" + sum +
                ", 车厢数：" + boxNum+")";
    }
    public int getBoxNum() {
        return boxNum;
    }
}

class Track extends Car{
    public int Weight;

    public int getWeight() {
        return Weight;
    }

    public Track(String id, String license, String company, String buyTime, String type, int mile, float oilConsumption, int protectMoney, int roadMoney, float sum, int weight) {
        super(id, license, company, buyTime, type, mile, oilConsumption, protectMoney, roadMoney, sum);
        Weight = weight;
    }
    @Override
    public String toString() {
        return "卡车：\n(" +
                "车辆编号：" + id +
                ", 车牌号：" + license +
                ", 制造公司：" + company +
                ", 购买时间：" + buyTime +
                ", 公里数：" + mile +
                ", \n耗油量：" + oilConsumption +
                ", 基本保养费用：" + protectMoney +
                ", 养路费：" + roadMoney +
                ", 累计费用：" + sum +
                ", 最大承重量：" + Weight+")";
    }
}

